﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Activities;
using System.Data;

namespace FusionDotNet.WorkflowActivities
{
    public sealed class UpdateActivity : FusionActivityBase<bool, CommandResult>
    {
        [RequiredArgument]
        public InArgument<DataRow> RowData { get; set; }

        public override Command<CommandResult> CreateCommand(System.Activities.AsyncCodeActivityContext context)
        {
            return new UpdateCommand(context.GetValue(RowData));
        }

        public override bool CreateResult(CommandResult commandResult)
        {
            return commandResult.HasExceptions == false;
        }
    }
}
